import Blockly from 'blockly'
const defaultBlockStyles = {
  colour_blocks: {
    colourPrimary: '#a52714', // 主要颜色
    colourSecondary: '#FB9B8C', // 阴影块颜色
    colourTertiary: '#FBE1DD' // 边框颜色
  },
  // 动作
  action_blocks: {
    colourPrimary: '#7A7A43'
  },
  // 组件
  component_blocks: {
    colourPrimary: '#317bc7'
  },

  list_blocks: {
    colourPrimary: '230'
    // 'colourSecondary': '#AD7BE9',
    // 'colourTertiary': '#CDB6E9'
  },
  logic_blocks: {
    colourPrimary: '210'
    // 'colourSecondary': '#64C7FF',
    // 'colourTertiary': '#C5EAFF'
  },

  loop_blocks: {
    colourPrimary: '210'
    // 'colourSecondary': '#9AFF78',
    // 'colourTertiary': '#E1FFD7'
  },
  math_blocks: {
    colourPrimary: '230'
    // 'colourSecondary': '#8A9EFF',
    // 'colourTertiary': '#DCE2FF'
  },
  tool_blocks: {
    // 工具
    colourPrimary: '230'
    // 'colourSecondary': '#8A9EFF',
    // 'colourTertiary': '#DCE2FF'
  },
  procedure_blocks: {
    colourPrimary: '290'
    // 'colourSecondary': '#77E6EE',
    // 'colourTertiary': '#CFECEE'
  },
  text_blocks: {
    colourPrimary: '160'
    // 'colourPrimary': '#067D17'
    // 'colourSecondary': '#5ae27c',
    // 'colourTertiary': '#D2FFDD'
  },
  variable_blocks: {
    colourPrimary: '330'
    // 'colourSecondary': '#FF73BE',
    // 'colourTertiary': '#FFD4EB'
  },
  variable_dynamic_blocks: {
    colourPrimary: '#880e4f',
    colourSecondary: '#FF73BE',
    colourTertiary: '#FFD4EB'
  },
  hat_blocks: {
    colourPrimary: '#880e4f',
    colourSecondary: '#FF73BE',
    colourTertiary: '#FFD4EB',
    hat: 'cap'
  }
}

const categoryStyles = {
  action_category: { colour: '#7A7A43' },
  component_category: { colour: '#317bc7' },
  tool_category: { colour: '230' },
  // no use
  list_category: { colour: '#0033B3' },
  logic_category: { colour: '#1743B9' },
  loop_category: { colour: '#1743B9' },
  math_category: { colour: '#0033B3' },
  procedure_category: { colour: '#00627A' },
  text_category: { colour: '#067D17' },
  variable_category: { colour: '#248F8F' },
  // no use
  variable_dynamic_category: { colour: '#880e4f' },
  colour_category: { colour: '#a52714' }
}
Blockly.registry.unregister('theme', 'customTheme')

/**
 * High contrast theme.
 */
export default Blockly.Theme.defineTheme('customTheme', {
  blockStyles: defaultBlockStyles,
  categoryStyles: categoryStyles,
  componentStyles: {
    selectedGlowColour: '#000000',
    selectedGlowSize: 1,
    replacementGlowColour: '#000000'
  },
  fontStyle: {
    family: null // Use default font-family.
    // 'weight': null // Use default font-weight.
    // 'size': 16
  },
  startHats: null
})
